UP
- Fórum
- OTServ
- Pedidos
- Resolvidos
- [PEDIDO]Passiva Early Bird e Insomnia
[PEDIDO]Passiva Early Bird e Insomnia
Por Darknessnone, 13 de set. de 2016 em Resolvidos
info
Grupo: Campones
Registrado: 17/09/12
Posts: 18
Reputação: +3

info
Grupo: Visconde
Registrado: 08/12/15
Posts: 309
Reputação: +133
Gênero: Masculino

Manda a função de Sleep da sua base, por exemplo, na base DxP fica em status library a function doSleep ...
info
Grupo: Campones
Registrado: 17/09/12
Posts: 18
Reputação: +3

Bom dia @samlecter, desculpe a demora é que tive que viajar, na minha status library encontrei isso
[5] = {n = "sleep", m = 98271},
É só isso ou tem algo mais? agradecido ![]()
info
Grupo: Visconde
Registrado: 08/12/15
Posts: 309
Reputação: +133
Gênero: Masculino

Em 22/09/2016 at 10:43, Darknessnone disse:Bom dia @samlecter, desculpe a demora é que tive que viajar, na minha status library encontrei isso
[5] = {n = "sleep", m = 98271},
É só isso ou tem algo mais? agradecido
Não é só isso não, eu fiz e testei na base DxP, a função de sleep lá fica em status library.lua , é essa aqui:
function doSleep(target, rounds, first)local cid = target if not isCreature(target) then return true end if getPlayerStorageValue(target, 21099) >= 1 then return true end --edited reflect if getPlayerStorageValue(target, 98271) >= 1 and rounds ~= 0 then return true end --edited pra nao contar os efeitos if not isSleeping(target) then addEvent(doSendSleepEffect, 500, target) end if isSleeping(target) and first then setPlayerStorageValue(target, 98271, getPlayerStorageValue(target, 98271) + rounds) return true end local outfits = {366, 912, 1317, 952, 909, 910} if isInArray(outfits, getCreatureOutfit(target).lookType) then setPlayerStorageValue(target, 98654, getCreatureOutfit(target).lookType) --edited pra da passivas ms quando esta durmindo!! end if isPlayer(target) then mayNotMove(target, true) else doChangeSpeed(target, -getCreatureSpeed(target)) endif not isPlayer(cid) then passivaOutfit = {652, 878, 496, 918, 849, 1193, 1194, 1192} Info = getMonsterInfo(getCreatureName(target)).lookCorpse --edited pra da passivas ms quando esta durmindo!! look = getCreatureOutfit(target) end if isMonster(target) then if getCreatureName(target) == "Ditto" and isSummon(target) and getPlayerStorageValue(target, 1010) ~= "Ditto" then local InfoDitto = getMonsterInfo(getPlayerStorageValue(target, 1010)).lookCorpse if InfoDitto ~= 0 and look.lookType ~= 0 and not isInArray(passivaOutfit, look.lookType) then doSetCreatureOutfit(target, {lookType = 0, lookTypeEx = getMonsterInfo(getPlayerStorageValue(target, 1010)).lookCorpse}, -1) end else --edited pra da passivas ms quando esta durmindo!! if Info ~= 0 and look.lookType ~= 0 and not isInArray(passivaOutfit, look.lookType) then doSetCreatureOutfit(target, {lookType = 0, lookTypeEx = getMonsterInfo(getCreatureName(target)).lookCorpse}, -1) end end end if rounds and rounds > 0 then setPlayerStorageValue(target, 98271, rounds) if isSummon(target) then doItemSetAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "sleep", rounds) end end setPlayerStorageValue(target, 98271, getPlayerStorageValue(target, 98271) - 1) if getPlayerStorageValue(target, 98271) <= 0 then if isPlayer(target) then mayNotMove(target, false) else doRegainSpeed(target) end if not isPlayer(target) then if getCreatureName(target) == "Ditto" and isSummon(target) and getPlayerStorageValue(target, 1010) ~= "Ditto" then doSetCreatureOutfit(target, {lookType = getItemAttribute(getPlayerSlotItem(getCreatureMaster(target), 8).uid, "transOutfit")}, -1) else doRemoveCondition(target, CONDITION_OUTFIT) end if getPlayerStorageValue(target, 98654) >= 1 then setPlayerStorageValue(target, 98654, -1) end end return true end if isSummon(target) then doItemSetAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "sleep", getPlayerStorageValue(cid, 98271)) end addEvent(doSleep, 1100, target, 0, false)return trueend
Com as alterações necessárias, fica assim:
unction doSleep(target, rounds, first)local cid = target if not isCreature(target) then return true end if getPlayerStorageValue(target, 9778981) >= 1 then return true end -- Insomnia storage if getPlayerStorageValue(target, 21099) >= 1 then return true end --edited reflect if getPlayerStorageValue(target, 98271) >= 1 and rounds ~= 0 then return true end --edited pra nao contar os efeitos if not isSleeping(target) then addEvent(doSendSleepEffect, 500, target) end if isSleeping(target) and first then setPlayerStorageValue(target, 98271, getPlayerStorageValue(target, 98271) + rounds) return true end local outfits = {366, 912, 1317, 952, 909, 910} if isInArray(outfits, getCreatureOutfit(target).lookType) then setPlayerStorageValue(target, 98654, getCreatureOutfit(target).lookType) --edited pra da passivas ms quando esta durmindo!! end if isPlayer(target) then mayNotMove(target, true) else doChangeSpeed(target, -getCreatureSpeed(target)) endif not isPlayer(cid) then passivaOutfit = {652, 878, 496, 918, 849, 1193, 1194, 1192} Info = getMonsterInfo(getCreatureName(target)).lookCorpse --edited pra da passivas ms quando esta durmindo!! look = getCreatureOutfit(target) end if isMonster(target) then if getCreatureName(target) == "Ditto" and isSummon(target) and getPlayerStorageValue(target, 1010) ~= "Ditto" then local InfoDitto = getMonsterInfo(getPlayerStorageValue(target, 1010)).lookCorpse if InfoDitto ~= 0 and look.lookType ~= 0 and not isInArray(passivaOutfit, look.lookType) then doSetCreatureOutfit(target, {lookType = 0, lookTypeEx = getMonsterInfo(getPlayerStorageValue(target, 1010)).lookCorpse}, -1) end else --edited pra da passivas ms quando esta durmindo!! if Info ~= 0 and look.lookType ~= 0 and not isInArray(passivaOutfit, look.lookType) then doSetCreatureOutfit(target, {lookType = 0, lookTypeEx = getMonsterInfo(getCreatureName(target)).lookCorpse}, -1) end end end if rounds and rounds > 0 then setPlayerStorageValue(target, 98271, rounds) if isSummon(target) then doItemSetAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "sleep", rounds) end end setPlayerStorageValue(target, 98271, getPlayerStorageValue(target, 98271) - 1) if getPlayerStorageValue(target, 98271) <= 0 then if isPlayer(target) then mayNotMove(target, false) else doRegainSpeed(target) end if not isPlayer(target) then if getCreatureName(target) == "Ditto" and isSummon(target) and getPlayerStorageValue(target, 1010) ~= "Ditto" then doSetCreatureOutfit(target, {lookType = getItemAttribute(getPlayerSlotItem(getCreatureMaster(target), 8).uid, "transOutfit")}, -1) else doRemoveCondition(target, CONDITION_OUTFIT) end if getPlayerStorageValue(target, 98654) >= 1 then setPlayerStorageValue(target, 98654, -1) end end return true end if isSummon(target) then doItemSetAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "sleep", getPlayerStorageValue(cid, 98271)) end addEvent(doSleep, 1100, target, 0, false) -- /// EARLY BIRD /// if getPlayerStorageValue(target, 9778982) >= 1 thenEarlyBirdTime = 2*1000 -- Tempo (em segundos) que o pokemon acordará antes, ex: Sleep dura 5 segundos, se tiver a passiva vai durar 3 segundos (5-2) -- mudar, colocar o tempo como porcentagem, ex, sleep dura 5 segundos, com a passiva vai dura tempo do sleep - 40% ? if isSummon(cid) then addEvent(doCureBallStatus, EarlyBirdTime, getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "sleep") --doCureBallStatus(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "all")endaddEvent(doCureStatus, EarlyBirdTime, cid, "sleep") --doCureStatus(cid, "all") end -- /// FIM EARLY BIRD /// return trueend
Sua base não é a DxP, então sua function de Sleep é diferente, acha ela e me manda o arquivo em que ela está p/ poder adaptar, deve estar em newStatusSyst.lua (dentro da pasta lib), a function pode estar com um nome parecido, por ex doSleep2 (achei assim em uma outra base, print abaixo)![]()
Código das passivas (coloca no pokemon moves.lua do seu server como se fosse uma spell comum) e adiciona nos outros locais necessários (spells.xml, moves.lua e xml da spell...):
elseif spell == "Insomnia" thenif getPlayerStorageValue(cid, 9778981) == 1 thenreturn trueendsetPlayerStorageValue(cid, 9778981, 1)elseif spell == "Early Bird" then if getPlayerStorageValue(cid, 9778982) <= 0 thensetPlayerStorageValue(cid, 9778982, 1)end
Para quem usa Base Dxp, só alterar em status library a function doSleep e adiciona o código das spells:
http://hastebin.com/iqupazudiy.lua
Editado Setembro 24 por samlecter
info
Grupo: Visconde
Registrado: 08/12/15
Posts: 309
Reputação: +133
Gênero: Masculino

@Darknessnone Resolvido? caso sim, por favor marque como melhor resposta, assim o tópico fica como resolvido


info
Grupo: Campones
Registrado: 17/09/12
Posts: 18
Reputação: +3
Boa noite familia Xtibiana!
Hoje vim fazer um PEDIDO de script de algumas passivas pra add no meu servidor
(OBS: Base PDA - Cyan)
*Early Bird: O pokemon acorda mais rapidamente de sleeps, exemplo: Ao tomar um sleep de 8 segundos, ele fixamente reduzirá 5 segundos do sleep, logo no total ele só ficaria 3 segundos adormecido ...
Cooldown: Nenhum, ela deve ficar sempre ativa;
Segundos de sleep reduzido: 5
Efeito: Nenhum
*Insomnia: Mais uma passiva relacionada á sleep, porém dessa vez os pokemons que tem essa passiva nunca tomarão sleep ...
Cooldown: Nenhum, sempre ativa;
Efeito: Nenhum, gostaria que aparecesse escrito em cima do pokemon "INSOMNIA" toda vez que ele tomasse um sleep e a passiva anulasse!
Esses são meus pedidos, como não manjo de script gostaria muito de uma ajudinha nisso, acredito que não é algo muito dificil, porém pra quem não sabe programar é complicado. Agradeço desde já!